package hu.issue.framework.web.servlet;

import javax.servlet.http.HttpServletRequest;

class ControllerMapper {

	public String map(final HttpServletRequest request) {
		final String uri = request.getRequestURI();
		final int delimiterIndex = uri.lastIndexOf('/');
		final int extIndex = uri.lastIndexOf(".do");
		if (extIndex == -1) {
			return null;
		}
		final String controllerName = uri.substring(delimiterIndex + 1, extIndex);

		return controllerName;
	}

}
